import request from '@/utils/request'
export function getUsers() {
    return request({
        url: '/users'
    })
}

export function deleteUser(id) {
    return request({
        url: `/users/${id}`,
        method: 'delete'
    })
}

export function insertUser(data) {
    return request({
        url: '/users',
        method: 'post',
        data
    })
}

export function selectUserById(id) {
    return request({
        url: `/users/${id}`
    })
}

export function updateUser(data) {
    return request({
        url: '/users',
        method: 'put',
        data
    })
}

export function getRoles() {
    return request({
        url: '/roles'
    })
}

export function getRolesDetails(id) {
    return request({
        url: `/roles/details/${id}`
    })
}